<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goBack = () => {
  router.back()
}

const goHome = () => {
  router.push('/')
}
</script>

<template>
  <div class="notfound-container">
    <div class="notfound-content">
      <el-result
        icon="warning"
        title="404"
        sub-title="很抱歉，您访问的页面不存在"
      >
        <template #extra>
          <div class="action-buttons">
            <el-button type="primary" @click="goBack">返回上一页</el-button>
            <el-button @click="goHome">返回首页</el-button>
          </div>
        </template>
      </el-result>
    </div>
  </div>
</template>

<style scoped>
.notfound-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f0f2f5;
  justify-content: center;
  align-items: center;
}

.notfound-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  padding: 24px;
  width: 100%;
  max-width: 500px;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

@media (max-width: 576px) {
  .notfound-content {
    margin: 16px;
    width: calc(100% - 32px);
  }
  
  .action-buttons {
    flex-direction: column;
  }
}
</style> 